<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
    <div class="form-group">
        <input id="id" data-rule="" size="50" type="hidden" value="{$id}">
        <!-- <div class="box">
                <label for="c-avatar" class="control-label col-xs-12 col-sm-2">消费金额:</label>
                <div class="col-xs-12 col-sm-4">
                    <input id="money" data-rule="required" class="form-control" name="row[money]" type="number" value="">
                </div>
        </div> -->

        <div class="form-group">
            <label for="c-money" class="control-label col-xs-12 col-sm-2">提现积分:</label>
            <div class="col-xs-12 col-sm-4">
                <input id="score" data-rule="" class="form-control" name="row[score]" type="number" value="{$score}"
                    autocomplete="">
            </div>
        </div>
        <!-- <div class="form-group layer-footer"> -->
            <label class="control-label col-xs-12 col-sm-2"></label>
            <div class="col-xs-12 col-sm-8">
                <div  id="btn1" class="btn btn-success btn-embossed">确定提现</div>
                <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
            </div>
        <!-- </div> -->
    </div>
</form>

<script src="/assets/js/jquery.js"></script>
<script type="text/javascript">
    $("#btn1").click(function () {
        var score = $('#score').val();
        var id = $('#id').val();
        // alert(score);
        // return false;
        layer.confirm('确定提现积分吗？',
            {
                icon: 3,
                title: '温馨提示',
                yes: function (index) {
                    $.ajax({
                        url: '{:url("saveScore")}',
                        type: 'post',
                        dataType: 'json',
                        data: { 'score': score, 'id': id },
                        success: function (res) {
                            if (res.code == 1) {
                                parent.location.reload();
                            } else {
                                layer.msg(res.msg,{icon:2,time:2000});
                            }
                        }
                    })
                    layer.close(index);
                },
                cancel: function (index, layero) {
                    layer.close(index);
                    return false;
                }
            });


    });
</script>